import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '用户',
    align: "center",
    dataIndex: 'userId_dictText'
  },
  {
    title: '营业执照',
    align: "center",
    dataIndex: 'businessLicense',
    customRender: render.renderImage,
  },
  {
    title: '认证状态',
    align: "center",
    dataIndex: 'authStatus_dictText'
  },
  {
    title: '企业名称',
    align: "center",
    dataIndex: 'companyName'
  },
  {
    title: '营业执照号码',
    align: "center",
    dataIndex: 'businessLicenseNo'
  },
  {
    title: '法人姓名',
    align: "center",
    dataIndex: 'legalName'
  },
  {
    title: '状态',
    align: "center",
    dataIndex: 'status_dictText'
  },
  {
    title: '经营范围',
    align: "center",
    dataIndex: 'busiRange'
  },
  {
    title: '组织形式',
    align: "center",
    dataIndex: 'orgMode'
  },
  {
    title: '注册资本',
    align: "center",
    dataIndex: 'regBalance'
  },
  {
    title: '有效期',
    align: "center",
    dataIndex: 'validDate'
  },
  {
    title: '实收资本',
    align: "center",
    dataIndex: 'recBalance'
  },
  {
    title: '有效期起始日期',
    align: "center",
    dataIndex: 'validSdate'
  },
  {
    title: '核准日期',
    align: "center",
    dataIndex: 'checkDate'
  },
  {
    title: '成立日期',
    align: "center",
    dataIndex: 'bornDate'
  },
  {
    title: '税务登记号',
    align: "center",
    dataIndex: 'taxRegNu'
  },
  {
    title: '地址',
    align: "center",
    dataIndex: 'addr'
  },
  {
    title: '登记机关',
    align: "center",
    dataIndex: 'regOrg'
  },
  {
    title: '类型',
    align: "center",
    dataIndex: 'companyType'
  },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "用户",
    field: 'userId',
    component: 'JSearchSelect',
    componentProps:{
      dict: "sys_user,realname,id"
    },
    //colProps: {span: 6},
  },
  {
    label: "认证状态",
    field: 'authStatus',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "company_auth_status"
    },
    //colProps: {span: 6},
  },
  {
    label: "企业名称",
    field: 'companyName',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "营业执照号码",
    field: 'businessLicenseNo',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "法人姓名",
    field: 'legalName',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "状态",
    field: 'status',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "row_status"
    },
    //colProps: {span: 6},
  },
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '用户',
    field: 'userId',
    component: 'JSearchSelect',
    componentProps:{
      dict: "sys_user,realname,id"
    },
  },
  {
    label: '营业执照',
    field: 'businessLicense',
    component: 'JImageUpload',
    componentProps:{
      fileMax: 1
    },
  },
  {
    label: '认证状态',
    field: 'authStatus',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "company_auth_status"
    },
  },
  {
    label: '企业名称',
    field: 'companyName',
    component: 'Input',
  },
  {
    label: '营业执照号码',
    field: 'businessLicenseNo',
    component: 'Input',
  },
  {
    label: '法人姓名',
    field: 'legalName',
    component: 'Input',
  },
  {
    label: '状态',
    field: 'status',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "row_status"
    },
  },
  {
    label: '经营范围',
    field: 'busiRange',
    component: 'Input',
  },
  {
    label: '组织形式',
    field: 'orgMode',
    component: 'Input',
  },
  {
    label: '注册资本',
    field: 'regBalance',
    component: 'Input',
  },
  {
    label: '有效期',
    field: 'validDate',
    component: 'Input',
  },
  {
    label: '实收资本',
    field: 'recBalance',
    component: 'Input',
  },
  {
    label: '有效期起始日期',
    field: 'validSdate',
    component: 'Input',
  },
  {
    label: '核准日期',
    field: 'checkDate',
    component: 'Input',
  },
  {
    label: '成立日期',
    field: 'bornDate',
    component: 'Input',
  },
  {
    label: '税务登记号',
    field: 'taxRegNu',
    component: 'Input',
  },
  {
    label: '地址',
    field: 'addr',
    component: 'Input',
  },
  {
    label: '登记机关',
    field: 'regOrg',
    component: 'Input',
  },
  {
    label: '类型',
    field: 'companyType',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];

// 高级查询数据
export const superQuerySchema = {
  userId: {title: '用户',order: 0,view: 'sel_search', type: 'string',dictTable: "sys_user", dictCode: 'id', dictText: 'realname',},
  businessLicense: {title: '营业执照',order: 1,view: 'image', type: 'string',},
  authStatus: {title: '认证状态',order: 2,view: 'radio', type: 'string',},
  companyName: {title: '企业名称',order: 3,view: 'text', type: 'string',},
  businessLicenseNo: {title: '营业执照号码',order: 4,view: 'text', type: 'string',},
  legalName: {title: '法人姓名',order: 5,view: 'text', type: 'string',},
  status: {title: '状态',order: 6,view: 'list', type: 'string',dictCode: 'row_status',},
  busiRange: {title: '经营范围',order: 7,view: 'text', type: 'string',},
  orgMode: {title: '组织形式',order: 8,view: 'text', type: 'string',},
  regBalance: {title: '注册资本',order: 9,view: 'text', type: 'string',},
  validDate: {title: '有效期',order: 10,view: 'text', type: 'string',},
  recBalance: {title: '实收资本',order: 11,view: 'text', type: 'string',},
  validSdate: {title: '有效期起始日期',order: 12,view: 'text', type: 'string',},
  checkDate: {title: '核准日期',order: 13,view: 'text', type: 'string',},
  bornDate: {title: '成立日期',order: 14,view: 'text', type: 'string',},
  taxRegNu: {title: '税务登记号',order: 15,view: 'text', type: 'string',},
  addr: {title: '地址',order: 16,view: 'text', type: 'string',},
  regOrg: {title: '登记机关',order: 17,view: 'text', type: 'string',},
  companyType: {title: '类型',order: 18,view: 'text', type: 'string',},
};
